package org.example.web14.demos.web.config;

import org.example.web14.demos.web.domain.Student;
import org.example.web14.demos.web.domain.Ticket;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyConfig {
    @Bean
    public Student getStudent(Ticket  ticket){
        System.out.println("创建Student对象");
        return new Student("张三",100, ticket);
    }

    @Bean
    public Ticket getTicket(){
        System.out.println("创建Ticket对象");
        return new Ticket("wuha",122);
    }
}
